package com.cmower.baeldung.random;

import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;

public class GenerateRandomThreadLocal {
    public static void main(String[] args) {
        int leftLimit = 2;
        int rightLimit = 11;

        Runnable r = () -> {
            ThreadLocalRandom t = ThreadLocalRandom.current();
            int generatedInteger = t.nextInt(leftLimit, rightLimit +1);
            System.out.println(generatedInteger);
        };
       for (int i = 1; i < 10; i++) {
           new Thread(r).start();
       }
    }
}
